﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Interfaces; // Brug vores class library "Interfaces"

namespace Model
{
    public class ClsPointPlaceringCollection
    {
        // Attributter
        ClsPointPlacering nyPointPlacering;
        List<ClsPointPlacering> listPointPlacering;

        public ClsPointPlaceringCollection()
        {
            listPointPlacering = new List<ClsPointPlacering>();
        }

        // Opret nyt pointsæt i model (instansiere) og lig i listen
        public void DownloadPointsaetFraDB(int placering, decimal point)
        {
            nyPointPlacering = new ClsPointPlacering(placering, point);
            listPointPlacering.Add(nyPointPlacering);
        }

        public List<ClsPointPlacering> ListPointPlacering
        {
            get { return listPointPlacering; }
        }

        // Metode til at hente liste med interfaceobjekter
        public List<IClsPointPlacering> GetPointPlacering()
        {
            List<IClsPointPlacering> tempPointPlacering = new List<IClsPointPlacering>();

            foreach (var item in listPointPlacering)
            {
                tempPointPlacering.Add((IClsPointPlacering)item);
            }

            return tempPointPlacering;
        }


    }
}
